package cn.hackertools.staticresource.controller;

import cn.hackertools.staticresource.entity.Project;
import cn.hackertools.staticresource.service.ProjectServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/project")
public class ProjectController {

    @Autowired
    private ProjectServiceImpl projectService;

    @RequestMapping(value = "/main")
    public String main(){
        return "project/main";
    }
    @RequestMapping(value = "/createProject")
    @ResponseBody
    public Object createProject(Project project){
        projectService.createProject(project);
        return "";
    }

    @RequestMapping(value = "/input")
    public String input(){
        return "project/input";
    }

    @ResponseBody
    @RequestMapping(value = "/getList")
    public Object getList(){
        return projectService.getList();
    }
    @ResponseBody
    @RequestMapping(value = "/delProject")
    public Object delProject(String projectId){
        projectService.delProject(projectId);
        return "success";
    }

}


